-
Notifications
You must be signed in to change notification settings - Fork 19
Set generate without sourcecode as a default to sphinx to reduce spac… #279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set generate without sourcecode as a default to sphinx to reduce spac… #279
Conversation
…e in the gh_pages by approx. 10%. Add option to generate sourcecode via bazel //:docs -- --sphinx_args -t source
License Check Results🚀 The license check job ran with the Bazel command: bazel run //src:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
| def setup(app: Sphinx) -> dict[str, object]: | ||
|
|
||
| # Tag-recognition | ||
| if app.tags.has("source"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use tags here? I don't think they are designed for such configuration purposes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're certainly right there, as tags should really be used for conditional passages in the documentation. Of course, I can also make this a generic build option again if that would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a patch which removes the 'tag' from the setup function. Instead now a configuration value is used which is the better choice I think. Therefore you have to use bazel run //:docs -- sphinx_args -D enable_source_generation=1 if you want a website with soucecode in it.
|
Do you have some benchmark for the 10% in size reduction? Because the source code linkage only adds some txt files. Also I would prefer if it would be the other way around: to pass a parameter to the bazel command that disables the sourcecode linking, by default being enabled. |
…g which shall be used more for content
…core_docs-as-code into feature/sourceopt
|
I just built the documentation https://github.com/eclipse-score/score/tree/main/docs. |
|
Another option is to look into the We could also look into minifying the HTML pages. |
|
@ubmarco : I will have a look into this, how to remove .doctrees before copying the website to gh-pages. |
|
@ubmarco : I've looked into the branch gh-pages, in main or the pr-xxxx directories the .doctrees directory is not available. Therefore nothing we can optimize here. |
It's not linking. It's embedding the source code redundantly into the html pages. The link remains available either way. |
Potentially a happy accident that some command ignores |
| if "score_sphinx_bundle.source_code_linker" in app.config.extensions: | ||
| app.config.extensions.remove("score_sphinx_bundle.source_code_linker") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove source code links here as well?
|
|
||
| # recognition of configuration value | ||
| app.add_config_value("enable_source_generation", False, "html") | ||
| if app.config.enable_source_generation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need configuration for this. Simply always disable source generation.
…ourcecode' always
26e7a78 to
163fd80
Compare
|
|
||
|
|
||
| def setup(app: Sphinx) -> dict[str, object]: | ||
| if "score_sphinx_bundle.source_code_linker" in app.config.extensions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need the score source linker. This is not about the rst sources but about traceability to C++/Rust sources.

…e in the gh_pages by approx. 10%. Add option to generate sourcecode via bazel //:docs -- --sphinx_args -t source
📌 Description
There is only 1GB of space available in gh-pages. Therefore, websites created through PR or updates on mein should be as small as possible. For optimization purposes, I have therefore disabled the source code. If necessary, it can be regenerated using an option in the bazel call.
🚨 Impact Analysis
✅ Checklist